package com.goldwind.chat.controller;

import com.goldwind.pojo.User;
import com.goldwind.user.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("chat")
@Controller
public class ToChatController {

    @Autowired
    private userService userService;

    @RequestMapping("1")
    public String toChat(String email,String userName,int userId,Model model){
        User user= userService.selectByEmail(email);

        model.addAttribute("user",user);
        model.addAttribute("userName",userName);
        model.addAttribute("userId",userId);
        return "chat/test";
    }
}
